﻿using Microsoft.EntityFrameworkCore.Migrations;

namespace EFModel.Migrations
{
    public partial class lq : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_engage_resume_config_file_first_kind_config_file_first_kindffk_id",
                table: "engage_resume");

            migrationBuilder.DropForeignKey(
                name: "FK_engage_resume_config_file_second_kind_config_file_second_kindfsk_id",
                table: "engage_resume");

            migrationBuilder.DropForeignKey(
                name: "FK_engage_resume_config_file_third_kind_config_file_third_kindftk_id",
                table: "engage_resume");

            migrationBuilder.DropIndex(
                name: "IX_engage_resume_config_file_first_kindffk_id",
                table: "engage_resume");

            migrationBuilder.DropIndex(
                name: "IX_engage_resume_config_file_second_kindfsk_id",
                table: "engage_resume");

            migrationBuilder.DropIndex(
                name: "IX_engage_resume_config_file_third_kindftk_id",
                table: "engage_resume");

            migrationBuilder.DropColumn(
                name: "config_file_first_kindffk_id",
                table: "engage_resume");

            migrationBuilder.DropColumn(
                name: "config_file_second_kindfsk_id",
                table: "engage_resume");

            migrationBuilder.DropColumn(
                name: "config_file_third_kindftk_id",
                table: "engage_resume");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<int>(
                name: "config_file_first_kindffk_id",
                table: "engage_resume",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "config_file_second_kindfsk_id",
                table: "engage_resume",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "config_file_third_kindftk_id",
                table: "engage_resume",
                type: "int",
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_engage_resume_config_file_first_kindffk_id",
                table: "engage_resume",
                column: "config_file_first_kindffk_id");

            migrationBuilder.CreateIndex(
                name: "IX_engage_resume_config_file_second_kindfsk_id",
                table: "engage_resume",
                column: "config_file_second_kindfsk_id");

            migrationBuilder.CreateIndex(
                name: "IX_engage_resume_config_file_third_kindftk_id",
                table: "engage_resume",
                column: "config_file_third_kindftk_id");

            migrationBuilder.AddForeignKey(
                name: "FK_engage_resume_config_file_first_kind_config_file_first_kindffk_id",
                table: "engage_resume",
                column: "config_file_first_kindffk_id",
                principalTable: "config_file_first_kind",
                principalColumn: "ffk_id",
                onDelete: ReferentialAction.Restrict);

            migrationBuilder.AddForeignKey(
                name: "FK_engage_resume_config_file_second_kind_config_file_second_kindfsk_id",
                table: "engage_resume",
                column: "config_file_second_kindfsk_id",
                principalTable: "config_file_second_kind",
                principalColumn: "fsk_id",
                onDelete: ReferentialAction.Restrict);

            migrationBuilder.AddForeignKey(
                name: "FK_engage_resume_config_file_third_kind_config_file_third_kindftk_id",
                table: "engage_resume",
                column: "config_file_third_kindftk_id",
                principalTable: "config_file_third_kind",
                principalColumn: "ftk_id",
                onDelete: ReferentialAction.Restrict);
        }
    }
}
